# Copyright 2010 Michael Penhallegon

# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an 'AS IS' BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Please reemeber this script is only compatible with python 3.0 and 2.7 not compatible <2.7
import os, json

#create path file is used by application to create correct paths
#needs to be customized for other deployments
print('**configuring paths**')
basepath = os.getcwd()
mediapath = basepath+'/media/'
templatepath = basepath+'/templates/'
apppath = basepath+'/dj/'
dbname = input('database name') 
dbuser = input('database user')
dbpass = input('database password')
photouser = str(input('picasa email: '))
photopass = str(input('picasa password: '))
pathfile = open('dj/paths.json','w')
json.dump({'basepath':basepath,'mediapath':mediapath,'templatepath':templatepath,'apppath':apppath,'dbname':dbname,'dbuser':dbuser,'dbpass':dbpass,'photouser':photouser,'photopass':photopass},pathfile)
pathfile.close()

# used to test to see if valid
#pathfile = open('dj/paths.json','r')
#print paths['mediapath']
print ('**saved paths**')
